<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<form action="CheckLogin" method="post">
		<h2>用户登录</h2>
		用户名：<input type="text" id="txt_userName" name="userName"/>
		密码：<input type="password" id="txt_password" name="password"/>
		<input type="submit" value="登录" onclick="javascript:return check();"/>
	</form>
</body>
<script type="text/javascript">
	function check() {
		var userName = document.getElementById("txt_userName").value;
		var password = document.getElementById("txt_password").value;
		
		if(userName == null || userName == "") {
			alert("用户名不能为空！");
			return false;
		}
		
		if(password == null || password == "") {
			alert("密码不能为空！");
			return false;
		}
		
		return true;
	}
</script>
</html>